/**
 * FileExistRule.java
 * @author: liuex
 * 2007-12-26 ����06:41:39
 *
 * note: 
 */
package org.lex.ftp.util.prefs;

public enum FileAction {
	ASK("Ask"), OVERWRITE("Auto Overwrite"), SKIP("Auto Skip"), RESUME("Auto Resume")
	// , RENAME("Auto Rename" )
	;
	private static final FileAction[] all = FileAction.values();

	public static String[] displayNames() {
		String[] names = new String[all.length];
		for (int i = 0; i < all.length; i++)
			names[i] = all[i].getDisplayName();
		return names;
	}

	public static FileAction byDisplayName(String displayName) {
		for (FileAction r : all)
			if (r.getDisplayName().equalsIgnoreCase(displayName))
				return r;
		throw new IllegalArgumentException("no element map to: " + displayName);
	}

	private String displayName = "";

	private FileAction(String displayName) {
		this.displayName = displayName;
	}

	public String getDisplayName() {
		return this.displayName;
	}
}
